package com.wnxy.sddfp.system.controller;

import com.wnxy.sddfp.common.exception.BusinessException;
import com.wnxy.sddfp.common.result.Result;
import com.wnxy.sddfp.common.result.enums.impl.BusinessCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/test1/{id}")
public Result test1(@PathVariable Integer id){
        if(id==2){
            throw new BusinessException(BusinessCode.fail);
        }
        return Result.ok("返回测试结果成功！！");

}


}
